using NUnit.Framework;
using CalcStats;
using System;

namespace TestCalcStats 
{
    
    [TestFixture]
    public class TestCalc 
    {
        
        [Test]
        public void ReturnMinimumWhenAskedTo() 
        {
            //Arrange
            Calc calcObject = new Calc();
            int minExpected = -2;

            //Act
            int minCalc = calcObject.Minimum();

            //Assert
            Assert.AreEqual(minExpected, minCalc);
        }

        [Test]
        public void ReturnMaximumWhenAskedTo()
        {
            //Arrange
            Calc calcObject = new Calc();
            int maxExpected = 92;

            //Act
            int maxCalc = calcObject.Maximum();

            //Assert
            Assert.AreEqual(maxExpected, maxCalc);
        }

        [Test]
        public void ReturnNumberOfElementsWhenAskedTo()
        {
            //Arrange
            Calc testee = new Calc();
            int numberExpected = 6;

            //Act
            int expectedNumber = testee.expectedN();

            //Assert
            Assert.AreEqual(expectedNumber, numberExpected);
        }


        [Test]
        public void ReturnAverageWhenAskedTo()
        {
            //Arrange
            Calc testee = new Calc();
            double averageExpected = 21.833333;

            //Act
            double averageResult = testee.averageN();

            //Assert
            Assert.Greater(averageExpected + 0.01, averageResult);
            Assert.Less(averageExpected, averageResult);
        }

    }
}
